package edu.suda.basic;

import java.io.UnsupportedEncodingException;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;

public class Record implements MapClassContent2ExcelRow
{
	private String	verifyStatus;
	private String	verifyDate;
	private String	holderName;
	private String	name;
	private String	gender;
	private String	IDNo;
	private String	account;
	private String	type;
	private String	address;

	public String getAccount()
	{
		return account;
	}

	public void setAccount(String account)
	{
		this.account = account;
	}

	public String getVerifyDate()
	{
		return verifyDate;
	}

	public void setVerifyDate(String verifyDate)
	{
		this.verifyDate = verifyDate;
	}

	public String getVerifyStatus()
	{
		return verifyStatus;
	}

	public void setVerifyStatus(String verifyStatus)
	{
		this.verifyStatus = verifyStatus;
	}

	public String getHolderName()
	{
		return holderName;
	}

	public void setHolderName(String holderName)
	{
		this.holderName = holderName;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getGender()
	{
		return gender;
	}

	public void setGender(String gender)
	{
		this.gender = gender;
	}

	public String getIDNo()
	{
		return IDNo;
	}

	public void setIDNo(String iDNo)
	{
		IDNo = iDNo;
	}

	public String getType()
	{
		return type;
	}

	public void setType(String type)
	{
		this.type = type;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public Record(String verifyStatus, String verifyDate, String holderName,
			String name, String gender, String IDNo, String account,
			String type, String address)
	{
		this.verifyDate = verifyDate;
		this.verifyStatus = verifyStatus;
		this.holderName = holderName;
		this.name = name;
		this.gender = gender;
		this.IDNo = IDNo;
		this.account = account;
		this.type = type;
		this.address = address;
	}

	public static int calcStrWidth(String str)
	{
		byte[] bs = null;
		if (str != null)
		{
			try
			{
				bs = str.getBytes("GB2312");
			}
			catch (UnsupportedEncodingException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return bs.length;
	}

	@Override
	public void map2ExcelColumn(Row row)
	{
		Cell cell = row.createCell(0);
		cell.setCellValue(this.getVerifyStatus());

		cell = row.createCell(1);
		cell.setCellValue(this.getVerifyDate());

		cell = row.createCell(2);
		cell.setCellValue(this.getHolderName());

		cell = row.createCell(3);
		cell.setCellValue(this.getName());

		cell = row.createCell(4);
		cell.setCellValue(this.getGender());

		cell = row.createCell(5);
		cell.setCellValue(this.getIDNo());

		cell = row.createCell(6);
		cell.setCellValue(this.getAccount());

		cell = row.createCell(7);
		cell.setCellValue(this.getType());

		cell = row.createCell(8);
		cell.setCellValue(this.getAddress());
	}

}
